cmake_minimum_required(VERSION 3.1)
project(MyPlugin)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

# 定义导出宏
add_definitions(-DMY_PLUGIN_EXPORT)

# 查找依赖
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
find_package(FastCAE REQUIRED)

# 源文件
set(SOURCES
    src/MyPlugin.cpp
    src/MyPluginImpl.cpp
)

# 头文件
set(HEADERS
    include/MyPlugin.h
    include/MyPluginGlobal.h
)

# 资源文件
set(RESOURCES
    resources/myplugin.qrc
)

# 创建动态库
add_library(${PROJECT_NAME} SHARED
    ${SOURCES}
    ${HEADERS}
    ${RESOURCES}
)

# 包含目录
target_include_directories(${PROJECT_NAME} PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${FastCAE_INCLUDE_DIRS}
)

# 链接库
target_link_libraries(${PROJECT_NAME} PRIVATE
    Qt5::Core
    Qt5::Widgets
    FastCAECore
    FastCAEAppFramework
) 